﻿using CuaHangLego.DataAccess;
using CuaHangLego.Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Bussiness.Parser
{
    public class HoaDonMuaParser
    {
        public static HoaDonMua Parse(SqlDataReader sdata)
        {
            HoaDonMua hd = new HoaDonMua();
            hd.MaSo = int.Parse(sdata["ID"].ToString());
            hd.NhaCungCap = NhaCungCapDA.Instance.GetByID(int.Parse(sdata["NhaCungCapID"].ToString()));
            hd.ThoiGian = DateTime.Parse(sdata["ThoiGian"].ToString());
            return hd;
        }
    }
}
